﻿using System;
using UnityEngine;

namespace UnityStandardAssets.ImageEffects
{
	// Token: 0x020004AC RID: 1196
	[RequireComponent(typeof(Camera))]
	[AddComponentMenu("")]
	public class ImageEffectBase : MonoBehaviour
	{
		// Token: 0x060018B3 RID: 6323 RVA: 0x0006BED5 File Offset: 0x0006A2D5
		protected virtual void Start()
		{
			if (!SystemInfo.supportsImageEffects)
			{
				base.enabled = false;
				return;
			}
			if (!this.shader || !this.shader.isSupported)
			{
				base.enabled = false;
			}
		}

		// Token: 0x17000204 RID: 516
		// (get) Token: 0x060018B4 RID: 6324 RVA: 0x0006BF10 File Offset: 0x0006A310
		protected Material material
		{
			get
			{
				if (this.m_Material == null)
				{
					this.m_Material = new Material(this.shader);
					this.m_Material.hideFlags = HideFlags.HideAndDontSave;
				}
				return this.m_Material;
			}
		}

		// Token: 0x060018B5 RID: 6325 RVA: 0x0006BF47 File Offset: 0x0006A347
		protected virtual void OnDisable()
		{
			if (this.m_Material)
			{
				UnityEngine.Object.DestroyImmediate(this.m_Material);
			}
		}

		// Token: 0x04000F3F RID: 3903
		public Shader shader;

		// Token: 0x04000F40 RID: 3904
		private Material m_Material;
	}
}
